package com.cai.file.demo;

import java.io.File;
import java.io.IOException;

public class Test1 {
    public static void main(String[] args) throws IOException {
        //当前目录下创建10个文件
        for (int i = 0; i < 10; i++) {
            File file=new File("./demo"+i+".txt");
            file.createNewFile();
        }
        System.out.println("创建完毕");


        for (int i = 0; i < 10; i++) {
            File file = new File("./demo" + i+".txt");
            file.delete();
        }
        System.out.println("删除完毕");
    }
}
